package Test.ThirdFive;

/**
 * 课程类
 * 成员变量：课程名称、课程学时
 */
public class Course {


    private String courseName;
    private int coursePeriod;

    /**
     * 带参数构造器
     * @param courseName     课程名称
     * @param coursePeriod   课程学时
     */
    public Course(String courseName,int coursePeriod){
        this.courseName = courseName;
        this.coursePeriod = coursePeriod;
    }

    /**
     * 覆盖Object类toString()方法
     * @return 课程信息
     */
    @Override
    public String toString(){
        return "课程名：" + courseName + " 学时：" + coursePeriod;
    }


    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public void setCoursePeriod(int coursePeriod) {
        this.coursePeriod = coursePeriod;
    }


    public String getCourseName() {
        return courseName;
    }

    public int getCoursePeriod() {
        return coursePeriod;
    }
}
